package main

import "fmt"

func main() {
	sum := 0
	for i := 10; i < 9*9*9*9*9*6; i++ {
		if DigitFifthPowers(i) {
			sum += i
		}
	}
	fmt.Println(sum)
}

func DigitFifthPowers(i int) bool {
	sum, n := 0, i
	for n > 0 {
		tmp := n % 10
		n /= 10
		sum += tmp * tmp * tmp * tmp * tmp
	}

	if sum == i {
		return true
	}
	return false
}
